<?php

namespace app\index\controller;

use app\common\controller\Frontend;

class Index extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public function index()
    {
        $this->view->assign('logo', cdnurl(config('site.system_logo')));
        $this->view->assign('site_name', config('site.name'));
        $this->view->assign('beian', config('site.beian'));
        $path = 'web/images';
        $images = [];
        if(is_dir($path)){
            $files = scandir($path);
            foreach ($files as $image) {
                if (in_array(pathinfo($image, PATHINFO_EXTENSION), ['jpg', 'jpeg', 'png', 'gif'])) {
                    $images[] = $path.'/'.$image;
                }
            }
        }
        $this->view->assign('images', $images);
        $this->view->assign('main', 'web/main.png');
        return $this->view->fetch();
    }



    public function yis()
    {
        $ys = config('site.policy');
        $this->view->assign('ys', $ys);
        return $this->view->fetch();
    }





}
